#ifndef CLIENT_CONN_H
#define CLIENT_CONN_H

#include "base_conn.h"

struct client_options {
	int verbosity;
	asio::ip::tcp::endpoint tcp_listen_addr;
	asio::ip::udp::endpoint udp_server_addr;
};

class ClientConn: public BaseConn
{
	private:
		client_options opt;

		void handleUdpConnect  (Token tk, const boost::system::error_code& e);
		void handleReadHeader  (Token tk, const boost::system::error_code& e);
		void handleReadVersion (Token tk, const boost::system::error_code& e, int maxver, int extralen);
		void handleSentHeader  (Token tk, const boost::system::error_code& e);
	public:
		ClientConn(asio::io_service& ioservice_, UdpService& udpservice, client_options opt_);

		void handleTcpAccept();
};
typedef boost::shared_ptr<ClientConn> ClientConnRef;

#endif//CLIENT_CONN_H
